package cn.stylefeng.guns.modular.service;

import cn.stylefeng.guns.modular.entity.Schedule;
import cn.stylefeng.guns.modular.entity.Scheduleitem;
import cn.stylefeng.guns.modular.mapper.ScheduleitemMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;

/**
 * @author third_e
 * @create 2019/12/23 0023-下午 5:30
 */
@Service
public class ScheduleitemService extends ServiceImpl<ScheduleitemMapper, Scheduleitem> {

    @Resource
    private ScheduleitemMapper scheduleitemMapper;


    /**
     * 获取对应日程及所有日程项
     * @param scheduleId
     * @return
     */
    public Collection<Scheduleitem> selectByscheduleId(Long scheduleId){

        Collection<Scheduleitem> scheduleitems = this.baseMapper.selectScheduleitemByscheduleId(scheduleId);
        return scheduleitems;
    }


    /**
     * 删除框架项
     * @param scheduleitemId
     */
    public void  deleteScheduleitemById(Long scheduleitemId){
        this.baseMapper.deleteScheduleitemById(scheduleitemId);

    }

    /**
     * 删除全部日程项
     */
    public void  deleteAllScheduleitem(Long scheduleId){
        this.baseMapper.deleteAllScheduleitem(scheduleId);
    }


    public Scheduleitem getByDayAndFrameitemId(String scheduleitemDay,Long scheduleId, Long frameitemId){
        return this.baseMapper.getByDayAndFrameitemId(scheduleitemDay,scheduleId,frameitemId);
    }


}
